From df0618ca35643a6af106dbf3142ffec2b4390aec Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Fri, 24 Apr 2020 15:17:04 +0100 Subject: [PATCH] Don't require warnings that not all arches produce numpy 0/0 (in tvalues): armel doesn't scipy.stats NaN: Upstream already note i386 doesn't, we find ppc64el and s390x don't either Author: Rebecca N. Palmer Bug-Debian: https://bugs.debian.org/956882 Forwarded: no Gbp-Pq: Name dont_require_warnings.patch --- .../base/tests/test_generic_methods.py | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/statsmodels/base/tests/test_generic_methods.py b/statsmodels/base/tests/test_generic_methods.py index cedc27e..7e7b24c 100644 --- a/statsmodels/base/tests/test_generic_methods.py +++ b/statsmodels/base/tests/test_generic_methods.py @@ -109,19 +109,11 @@ class CheckGenericMixin(object): assert_equal(res1.bse[drop_index], 0) # OSX has many slight failures on this test tol = 1e-8 if PLATFORM_OSX else 1e-10 - with pytest.warns(RuntimeWarning, match="invalid value encountered"): - # division by zero in bse - tvals1 = res1.tvalues[keep_index_p] + tvals1 = res1.tvalues[keep_index_p] assert_allclose(tvals1, res2.tvalues, rtol=tol, atol=tol) # See gh5993 - if PLATFORM_LINUX32 or SCIPY_GT_14: - pvals1 = res1.pvalues[keep_index_p] - else: - with pytest.warns(RuntimeWarning, - match="invalid value encountered"): - # passing NaN into scipy.stats functions - pvals1 = res1.pvalues[keep_index_p] + pvals1 = res1.pvalues[keep_index_p] assert_allclose(pvals1, res2.pvalues, rtol=tol, atol=tol) if hasattr(res1, 'resid'): @@ -259,19 +251,11 @@ class CheckGenericMixin(object): assert_allclose(res1.params[drop_index], 0, rtol=1e-10) assert_allclose(res1.bse[keep_index_p], res2.bse, rtol=1e-8) assert_allclose(res1.bse[drop_index], 0, rtol=1e-10) - with pytest.warns(RuntimeWarning, match="invalid value"): - # zero in bse, so division by zero warning - tvals1 = res1.tvalues[keep_index_p] + tvals1 = res1.tvalues[keep_index_p] assert_allclose(tvals1, res2.tvalues, rtol=5e-8) # See gh5993 - if PLATFORM_LINUX32 or SCIPY_GT_14: - pvals1 = res1.pvalues[keep_index_p] - else: - with pytest.warns(RuntimeWarning, - match="invalid value encountered"): - # passing NaN into scipy.stats functions - pvals1 = res1.pvalues[keep_index_p] + pvals1 = res1.pvalues[keep_index_p] assert_allclose(pvals1, res2.pvalues, rtol=1e-6, atol=1e-30) if hasattr(res1, 'resid'): -- 2.30.2